package archer.application.core.entity.apitenant;

import archer.framework.common.entity.ActiveRecordEntity;
import archer.framework.security.ArcherSecurityModule;

import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * @author christ
 * @date 2016/6/3
 */
@Entity
public class ApiTenant extends ActiveRecordEntity implements archer.framework.security.apitenant.ApiTenant {

    public static final Find<ApiTenant> find = new Find<>(ApiTenant.class);

    @Id
    private String id;

    private String apikey;

    private String apisecret;

    private String type = TYPE_INTERNAL;

    private String name;

    private String remark;

    private String scope;

    private long tokenTimeout = ArcherSecurityModule.defaultTokenTimeout;

    public String getApikey() {
        return apikey;
    }

    public ApiTenant setApikey(String apikey) {
        this.apikey = apikey;
        return this;
    }

    public String getApisecret() {
        return apisecret;
    }

    public ApiTenant setApisecret(String apisecret) {
        this.apisecret = apisecret;
        return this;
    }

    public String getType() {
        return type;
    }

    public ApiTenant setType(String type) {
        this.type = type;
        return this;
    }

    public String getName() {
        return name;
    }

    public ApiTenant setName(String name) {
        this.name = name;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public ApiTenant setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    public String getScope() {
        return scope;
    }

    public ApiTenant setScope(String scope) {
        this.scope = scope;
        return this;
    }

    public long getTokenTimeout() {
        return tokenTimeout;
    }

    public ApiTenant setTokenTimeout(long tokenTimeout) {
        this.tokenTimeout = tokenTimeout;
        return this;
    }

    public String getId() {
        return id;
    }

    public ApiTenant setId(String id) {
        this.id = id;
        return this;
    }
}
